﻿@model MasResourceGroup

@{
    var resType = new KPIS.GERP.WEB.GIMS.MasResourceService.MasResourceServiceClient().
        SelectResourceType(new MasResourceType{ResTypeId = ViewBag.ResTypeId}, null).FirstOrDefault();
    ViewBag.CustomMenu = new Dictionary<string, string>
        {
            {
                "ประเภท" + resType.Name, Url.Action("Index", "MasResourceType")
            },
            {
                "หมวด", Url.Action("Index", "MasResourceGroup", new {resTypeId= resType.ResTypeId})
            }
        };
    ViewBag.ResType = resType;
	ViewBag.Title = "แก้ไขหมวดพัสดุ";
    ViewBag.Descr = "แก้ไขข้อมูลหมวดพัสดุ" + (Model.Name ?? string.Empty) ;
}

@using (Html.BeginForm("Edit", "MasResourceGroup", FormMethod.Post, new { @class = "form-horizontal", ViewBag.ResTypeId }))
{
    @Html.AntiForgeryToken()

    <div class="block-button-menu-above">
        @Html.ButtonViewAll(new{ViewBag.ResTypeId})
        @Html.ButtonSubmit()
        @Html.ButtonCancel(new { id = Model.ResGrpId, ViewBag.ResTypeId })
    </div>
    
    @Html.ValidationSummary(true, ValidateText.RequiredField, new { @class = "alert alert-error" })
    @Html.Partial("_EditorForm")
}